


import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom'

// -------------- 路由配置 --------------
import Login from './login/login';
import Home from './home/home';
import Company from './company/company';
import ProjectHome from './project/project-home';
import Project from './project/project';
const routes = [
  {
    path: '/',
    exact: true,
    component: Login
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/company',
    component: Company
  },
  {
    path: '/projectHome',
    component: ProjectHome
  },
  {
    path: '/project',
    component: Project
  }
];


const FadingRoute = ({ component: Component, ...rest }) => (
  <Route {...rest} render={props => (
    <div className='fadeIn full-page'>
      <Component {...props} />
    </div>
  )} />
)

class App extends Component {

  render() {
    return (
      <Router basename="/ccjs">
        <div className="full-page">
          {routes.map((route, i) => (
            <FadingRoute key={i} component={route.component} {...route} />
          ))}
        </div>

      </Router>
    );
  }
}

export default App;
